home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 28
/
Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso
/
Aminet
/
dev
/
c
/
dice-3.16.lha
/
doc
/
TUTORIAL
< prev
next >
Wrap
Text File
|
1994-02-13
|
28KB
|
678 lines
Every Emacs and Emacs varient I've ever used has had some variation
of this file. AME is no different. For its TUTORIAL, I've found the
GNU tutorial and modified it to match AME and the Amiga. After all,
Emacs just isn't Emacs without a tutorial. - andy finkel
---------------
Copyright (c) 1985 Free Software Foundation, Inc; See end for conditions.
You are looking at the AME tutorial.
AME commands generally involve the CONTROL key (labelled
CTRL) or the META key (labelled ESC). Rather than
write out META or CONTROL each time we want you to prefix a character,
we'll use the following abbreviations:
C-<chr> means hold the CONTROL key while typing the character <chr>
Thus, C-f would be: hold the CONTROL key and type f.
M-<chr> means type <ESC>, release it, then type the character <chr>.
"<ESC>" stands for the key labelled "ESC". The M stands
for Meta.
Important note: to end the AME session, type C-c. (One character.)
Other important note: In the various AME displays, a control character
will be displayed with a leading caret, ie ^C is control C.
The characters ">>" at the left margin indicate directions for you to
try using a command. For instance:
<<Blank lines inserted here by startup of help-with-tutorial>>
>> Now type C-v (View next screen) to move to the next screen.
(go ahead, do it by depressing the control key and v together).
From now on, you'll be expected to do this whenever you finish
reading the screen.
Note that there is an overlap when going from screen to screen; this
provides some continuity when moving through the file.
The first thing that you need to know is how to move around from
place to place in the file. You already know how to move forward a
screen, with C-v. To move backwards a screen, type M-v (which is <ESC>v).
>> Try typing M-v and then C-v to move back and forth a few times.
SUMMARY
-------
The following commands are useful for viewing screenfuls:
C-v Move forward one screenful
M-v Move backward one screenful
C-l Clear screen and redisplay everything
putting the text near the cursor at the center.
(That's control-L, not control-1.
There is no such character as control-1.)
>> Find the cursor and remember what text is near it.
Then type a C-l.
Find the cursor again and see what text is near it now.
BASIC CURSOR CONTROL
--------------------
Getting from screenful to screenful is useful, but how do you
reposition yourself within a given screen to a specific place?
There are several ways you can do this. One way (not the best, but
the most basic) is to use the commands previous, backward, forward
and next. As you can imagine these commands (which are given to
AME as C-p, C-b, C-f, and C-n respectively) move the cursor from
where it currently is to a new place in the given direction. Here,
in a more graphical form are the commands:
Previous line, C-p
:
:
Backward, C-b .... Current cursor position .... Forward, C-f
:
:
Next line, C-n
>> Move the cursor to the line in the middle of that diagram
and type C-l to see the whole diagram centered in the screen.
You'll probably find it easy to think of these by letter. P for
previous, N for next, B for backward and F for forward. These are
the basic cursor positioning commands and you'll be using them ALL
the time so it would be of great benefit if you learn them now.
In AME, the cursor arrow keys work as well; Cursor Up arrow is
previous line, cursor down arrow is next line, cursor left arrow is backward,
cursor right arrow is forward. This may be more convenient than using the
control sequences.
>> Do a few C-n's to bring the cursor down to this line.
>> Move into the line with C-f's and then up with C-p's.
See what C-p does when the cursor is in the middle of the line.
Lines are separated by Newline characters. For most applications
there should normally be a Newline character at the end of the text,
as well, but it is up to you to make sure of this. A file can
validly exist without a Newline at the end.
>> Try to C-b at the beginning of a line. Do a few more C-b's.
Then do C-f's back to the end of the line and beyond.
When you go off the top or bottom of the screen, the text beyond
the edge is shifted onto the screen so that your instructions can
be carried out while keeping the cursor on the screen.
>> Try to move the cursor off the bottom of the screen with C-n and
see what happens.
If moving by characters is too slow, you can move by words. M-f
(Meta-f) moves forward a word and M-b moves back a word.
>> Type a few M-f's and M-b's. Intersperse them with C-f's and C-b's.
Notice the parallel between C-f and C-b on the one hand, and M-f and
M-b on the other hand. Very often Meta characters are used for
operations related to English text whereas Control characters operate
on the basic textual units that are independent of what you are
editing (characters, lines, etc).
>> Try a couple of C-a's, and then a couple of C-e's.
See how repeated C-a's do nothing. Do you think that this is right?
Note: in AME, shift-cursor left acts the same as C-a , and
shift-cursor right acts the same as C-e.
Two other simple cursor motion commands are M-< (Meta Less-than),
which moves to the beginning of the file, and M-> (Meta Greater-than),
which moves to the end of the file. You probably don't need to try
them, since finding this spot again will be boring. On most terminals
the "<" is above the comma and you must use the shift key to type it.
On these terminals you must use the shift key to type M-< also;
without the shift key, you would be typing M-comma.
The location of the cursor in the text is also called "point". To
paraphrase, the cursor shows on the screen where point is located in
the text.
Here is a summary of simple moving operations including the word and
sentence moving commands:
C-f (Cursor Right) Move forward a character
C-b (Cursor Left) Move backward a character
M-f Move forward a word
M-b Move backward a word
C-n (Cursor Down) Move to next line
C-p (Cursor Up) Move to previous line
C-a (Shift Left) Move to beginning of line
C-e (Shift Right) Move to end of line
M-< Go to beginning of file
M-> Go to end of file
>> Try all of these commands now a few times for practice.
Since the last two will take you away from this screen,
you can come back here with M-v's and C-v's. These are
the most often used commands.
Like all other commands in AME, these commands can be given
arguments which cause them to be executed repeatedly. The way you
give a command a repeat count is by typing C-u and then the digits
before you type the command.
For instance, C-u 8 C-f moves forward eight characters.
>> Try giving a suitable argument to C-n or C-p to come as close
as you can to this line in one jump.
WHEN AME IS HUNG
-----------------
If AME gets into an infinite (or simply very long) computation which
you don't want to finish, you can stop it safely by typing C-g.
You can also use C-g to discard a numeric argument or the beginning of
a command that you don't want to finish.
>> Type C-u 100 to make a numeric arg of 100, then type C-g.
Now type C-f. How many characters does it move?
If you have typed an <ESC> by mistake, you can get rid of it
with a C-g.
WINDOWS
-------
AME can have several windows, each displaying its own text.
At this stage it is better not to go into the techniques of
using multiple windows. But you do need to know how to get
rid of extra windows that may appear to display help or
output from certain commands. It is simple:
C-x 1 One window (i.e., kill all other windows).
That is Control-x followed by the digit 1.
C-x 1 makes the window which the cursor is in become
the full screen, by getting rid of any other windows.
>> Move the cursor to this line and type C-u 0 C-l.
>> Type ESC-? move
See how this window shrinks, while a new one appears
to display a listing of the commands that contain move.
>> Type C-x 1 and see the help window disappear.
INSERTING AND DELETING
----------------------
If you want to insert text, just type it. Characters which you ca